﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Contracts.ClientTools
{
    public static class KnownTypeHelper
    {
        public static IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider)
        {
            Assembly asm = Assembly.Load ("Types");

            // Sadece datasetten turemis typeları tanımlayacağım. 
            
            List<Type> types = (from t in asm.GetTypes()
                               where t.IsSerializable && t.IsSubclassOf (typeof(System.Data.DataSet))
                               select t).ToList ();   
            return types;

        } 
    }
}
